import request from "@/utils/request.js";
import baseUrl from "@/utils/version.js";

export function delete_menu(id) {
    return request.delete(baseUrl.system.v1 + `/menu/${id}`);
}

export function update_menu(id, data) {
    return request.put(baseUrl.system.v1 + `/menu/${id}`, data);
}

export function status_menu(id) {
    return request.put(baseUrl.system.v1 + `/menu/status/${id}`);
}

export function get_menu(id) {
    return request.get(baseUrl.system.v1 + `/menu/${id}`);
}

export function list_menu_tree() {
    return request.get(baseUrl.system.v1 + "/menu");
}

export function menu_route_tree() {
    return request.get(baseUrl.system.v1 + "/menu/route/tree");
}